subroutine r2abij_t2efij_t1bm_iefam_io_g(r2, t2, t1, iabci,& 
               icore, fact)
!
use mod_iop
use mod_size
use mod_orbit
use mod_ioff
implicit none
!
real*4, intent(in),device :: r2(*)
real*4, intent(in),device :: t1(*)
real*4, intent(in) :: iabci(*)
!
real*4, intent(inout),device :: t2(*), icore(*)
!
integer :: i, j, a, b, nsize
integer :: i0, i1, i2, i3
real*8 :: fact
character*8 :: fname
integer, external :: idsymsoc
real*8, external :: dnrm2, nrm2so
!this is to do r2(ab,ij) = r2(abij) - P(ab)*0.5*t2(efij)*iabci(ef,am)*t1(bm)
i0 = 1           
i1 = i0 + nvvoo*isd   
i2 = i1 + nvvoo*isd    
i3 = i2 + nvvoo*isd
!
!====ABAB
if(prec==8) then 
  fname = 'ABCIAB__'
elseif(prec==4) then 
  fname = 'ABCIABS_'
endif
!----t2(Ef,Ij)*iabci(Ef,Am)*t1(bm) + t2(Fe,Ij)*iabci(eF,bM)*t1(AM)
call VmnpqVmnrs_to_Vpqrs_large_g2(t2(ioi3(2)), icore(i1), 1, 1, vrta, vrtb, 1, &
              popa, popb, 1, vrta, popb, 1, icore(i0), 1,  1.d0, 0.d0, & 
              fname, iabci) 
call VpqrmVsm_to_Vpqrs(icore(i0), t1(ifvo(2)), 1, 1, popb, &
                popa, popb, 1, vrta, vrtb, icore(i2), 1, 1.d0, 0.d0, 1)
call itranspso(icore(i2), icore(i1), popa, popb, 1, vrta, vrtb, 1, 1) 
call axpyso(nioi32, fact*2.d0, icore(i1), 1, r2(ioi3(2)), 1)
!------------------------------
if(prec==8) then 
  fname = 'ABCIAB__'
elseif(prec==4) then 
  fname = 'ABCIABS_'
endif
call isymtrso(t2(ioi3(2)), icore(i1), vrta,vrtb, 1, 1, popa, popb, 1, 0, 1)
call VmnpqVmnrs_to_Vpqrs_large_g2(icore(i1), icore(i2), 1, 1, vrtb, vrta, 1, &
              popa, popb, 1, vrtb, popa, 1, icore(i0), 1,  1.d0, 0.d0, & 
              fname, iabci) 
call VpqrmVsm_to_Vpqrs(icore(i0), t1(ifvo(1)), 1, 1, popa, &
                popa, popb, 1, vrtb, vrta, icore(i1), 1, 1.d0, 0.d0, 1)
call isymtrso(icore(i1), icore(i2), popa, popb, 1, 0, vrtb, vrta, 1, 1, 1)
!
call itranspso(icore(i2), icore(i1), popa, popb, 1, vrta, vrtb, 1, 1) 
call axpyso(nioi32, fact*2.d0, icore(i1), 1, r2(ioi3(2)), 1)
!write(6,*)'norm of abab in calciabcig',& 
!            nrm2so(ioi3(3)-ioi3(2), r2(ioi3(2)), 1)

!---- 

return
end
